#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
typedef struct x {
	int val;
	struct x* left;
	struct x* right;
}TreeNode;
void y(TreeNode* root, int* returnSize, int* x) {
    if (root == NULL)
        return;
    y(root->left, returnSize, x);
    x[(*returnSize)++] = root->val;
    y(root->right, returnSize, x);
}
int* inorderTraversal(TreeNode* root, int* returnSize) {
    int* x = (int*)malloc(sizeof(int) * 501);
    *returnSize = 0;
    y(root, returnSize, x);
    return x;
}
int main() {
    int* x = (int*)malloc(sizeof(int));
    TreeNode* root = (TreeNode*)malloc(sizeof(TreeNode));
    root->val = 1;
    root->left = NULL;
    TreeNode* a = (TreeNode*)malloc(sizeof(TreeNode));
    a->val = 2;
    a->right = NULL;
    TreeNode* b = (TreeNode*)malloc(sizeof(TreeNode));
    b->val = 3;
    b->left = NULL;
    b->right = NULL;
    root->right = a;
    a->left = b;
   
    
    int* y = inorderTraversal(root, x);
    int k = sizeof(y)/sizeof(int);
    for (int i = 0; i <= k; i++) {
        printf("%d ", y[i]);
    }
}